<script type="module">
  import { initializeApp, getApp } from "https://www.gstatic.com/firebasejs/9.22.2/firebase-app.js";
  import { getAuth } from "https://www.gstatic.com/firebasejs/9.22.2/firebase-auth.js";

  const app = initializeApp({
    projectId: "<%- env.GOOGLE_CLOUD_PROJECT %>",
    appId: "<%- env.FIREBASE_APP_ID %>",
    apiKey: "<%- env.FIREBASE_API_KEY %>",
    authDomain: "<%- env.FIREBASE_AUTH_DOMAIN %>",
  });

  const auth = getAuth(app);

  auth.onAuthStateChanged((user) => {
    if (user) {
      console.log("User is signed in");
    } else {
      console.log("User is signed out");
    }
  });
</script>

<script async src="https://www.googletagmanager.com/gtag/js?id=<%- env.GA_MEASUREMENT_ID %>"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() {
    dataLayer.push(arguments);
  }
  gtag("js", new Date());
  gtag("config", "<%- env.GA_MEASUREMENT_ID %>");
</script>
